<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>LiJPress</title>
    <meta name=”renderer” content=”webkit”>
    <meta http-equiv=”X-UA-Compatible” content=”IE=Edge,chrome=1″>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <!-- jQuery 2.1.4 -->
    <script src="${ctxPath}/plugins/jquery/jquery-2.1.4.min.js"></script>
    <script src="${ctxPath}/plugins/jquery/jquery.form.min.js"></script>
    <!-- Bootstrap 3.3.5 -->
    <script src="${ctxPath}/bootstrap/js/bootstrap.min.js"></script>
    <!-- FastClick -->
    <script src="${ctxPath}/plugins/fastclick/fastclick.min.js"></script>
    <!-- AdminLTE App -->
    <script src="${ctxPath}/lte/js/app.js"></script>
    <!-- AdminLTE for demo purposes -->
    <script src="${ctxPath}/admin/js/common.js"></script>
    <!-- layer -->
    <script src="${ctxPath}/layer/layer.js"></script>
    <!-- pace -->
    <script src="${ctxPath}/plugins/pace/pace.min.js"></script>
    <script src="${ctxPath}/plugins/toastr/toastr.js"></script>
    <!-- Bootstrap 3.3.5 -->
    <link rel="stylesheet" href="${ctxPath}/bootstrap/css/bootstrap.min.css">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="${ctxPath}/font-awesome/css/font-awesome.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="${ctxPath}/lte/css/AdminLTE.css">
    <link rel="stylesheet" href="${ctxPath}/lte/css/skins/_all-skins.css">
    <link rel="stylesheet" href="${ctxPath}/plugins/toastr/toastr.css">

    <!--[if lt IE 9]>
    <script src="${ctxPath}/plugins/html5/html5shiv.min.js"></script>
    <script src="${ctxPath}/plugins/html5/respond.min.js"></script>
    <![endif]-->
    <link rel="stylesheet" href="${ctxPath}/admin/css/common.css">
</head>
<body class="hold-transition skin-blue sidebar-mini">
<!-- Site wrapper -->
<div class="wrapper">
    <%include("_header.html"){}%>
    <%include("_menu.html"){}%>
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        ${layoutContent}
    </div>
    <!-- /.content-wrapper -->

    <footer class="main-footer">
        <div class="pull-right hidden-xs">
            <b>LiJPress</b> ${JPRESS_VERSION!}
        </div>
        <strong>Copyright &copy; 2015-2016 <a href="http://jpress.io" target="_blank">JPress.io</a>.</strong> All rights
        reserved.
    </footer>

</div>
<!-- ./wrapper -->
<script>

    $(document).ready(function () {
        initTree();
        fix();
        initUrls();
        initToast();
    });

    function initTree() {
        if (${active_id} != "" && ${active_id}) {
            var pActive = $("#" + ${active_id} +"[class='treeview']");
            pActive.attr("class", "treeview active");
            if (child_active_id != "" && child_active_id) {
                pActive.find("#" +${child_active_id}).attr("class", "active");
            }
        }
    }

    function fix() {
        var neg = $('.main-header').outerHeight() + $('.main-footer').outerHeight();
        var window_height = $(window).height();
        var sidebar_height = $(".sidebar").height();

        if (window_height >= sidebar_height + neg) {
            $(".content-wrapper, .right-side").css('min-height', window_height - neg);
        } else {
            $(".content-wrapper, .right-side").css('min-height', sidebar_height);
        }
    }

    function initUrls() {
        $(".treeview-menu").each(function () {
            var pid = $(this).parent().attr("id");
            if (typeof(pid) == 'undefined' || null == pid) {
                return;
            }
            $(this).find('a').each(function () {
                var cid = $(this).parent().attr("id");
                var href = $(this).attr("href");
                if (href.indexOf("?") == -1) {
                    href = href + "?p=" + pid;
                } else {
                    href = href + "&p=" + pid;
                }
                if ("undefined" != typeof(cid) && "" != cid) {
                    href += "&c=" + cid;
                }
                $(this).attr("href", href);
            });
        });
    }

    function initToast() {
        toastr.options = {
            "closeButton": true,
            "debug": false,
            "newestOnTop": false,
            "progressBar": true,
            "positionClass": "toast-top-center",
            "preventDuplicates": false,
            "onclick": null,
            "showDuration": "300",
            "hideDuration": "1000",
            "timeOut": "2000",
            "extendedTimeOut": "1000",
            "showEasing": "swing",
            "hideEasing": "linear",
            "showMethod": "fadeIn",
            "hideMethod": "fadeOut"
        }

    }
</script>
</body>
</html>